<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%@page isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Web Services simulator</title>
    <style type="text/css"><!--
body{font-family:sans-serif; text-align:center;}
div.container{width:520px; text-align:left;}
div.entry {
    clear:both;
}
label {
    width:187px;
    float:left;
    text-align:right;
    padding-top:2px;
    margin-bottom:13px;
    margin-right: 6px;
}
    --></style>
</head>
<body><center>
<div class="container">

    <h2>The Axial Health Exchange Service Demo</h2>

    <p><strong>Strong Identity Management</strong></p>

    <p>This demo is intended to show how to interact with PHR / EHR systems that have user account-based identity management systems. Those systems have a user account for each patient, and the patient herself can log in to control how her data is shared. Examples of such systems include Google Health, MS HealthVault, as well as patient portals for major hospitals and regional health services. Those are typically newer PHR / EHR systems. To see a demo for traditional EHR systems that use MPI (Master Patient Index) to match patient identity, please see <a href="mpi.jsp">this demo</a></p>

    <p>Before your application can send / receive data, you need to link up your user accounts with the same user's accounts in the target PHR / EHR system. That is a two step process. In this example, let's assume that we need to share records from the "myapp" EHR system to Google Health.</p>

    <p>First, the "myapp" app needs to tell the exchange that it needs to send health records for it's user 1234 to Google Health:</p>

<pre>
GET: /register?from=myapp&amp;uid=1234&amp;to=google
</pre>

    <p>This method returns an URL. Next, the myapp's UI needs to load this URL and present the page to the user. The page will ask the user to sign into Google Health and agree to share the data between the two systems.</p>

    <p>That's it! Once the user gives her credentials and logs in, the exchange system will now link user id 1234 in myapp to the user id in Google Health. The app can now send / receive records on the user's behalf.</p>

    <p><i><strong>Note:</strong></i> Typically, the exchange service does not store user passwords. We use OpenID style authentication to transport data across different PHR / EHR systems. In the above demo case, the user logs into a Google site, and gives her password to Google to verify her identity. The Axial Health Exchange does not capture the password.</p>



    <p><strong>How does it work?</strong></p>

    <p><i>Send a record</i></p>

    <p>Your application can make a web service call that says: <i>"send health record xyz for my user 1234 to her account in Google Health"</i> -- you can replace Google Health with any regional hospital / lab EHR system supported in the exchange, and the account number "1234" is your internal identification of the patient. The web service request is like this:</p>

<pre>
POST: /send?from=myapp&amp;uid=1234&amp;to=google
    BODY: record in CCR format
</pre>

    <p>Upon receiving the request, the Health Exchange service will do the following.</p>

    <ol>
        <li>Find your user 1234's account in the destination EHR system</li>
        <li>Format / translate the record data to a format accepted by the destination</li>
        <li>Send the record with proper authentication</li>
    </ol>

    <p><i>Receive a record</i></p>
    
    <p>To receive a record, your system needs to connected to Health Exchange via an HTTP callback API, or you can install our software agent inside your firewall to write directly to your database. Once a record arrives for one of your users, the exchange will authenticate the user based on your protocols (we recommend using OpenID authentication), and then write the data.</p>
    
    <p>In our demo, Google Health receives records for its users via the public GData API, and the authentication is done via Google AuthSub.</p>

    <p><i>Search / Retrieve a records</i></p>

    <p>To search / retrieve records from another EHR system, you can issue the following web services call:</p>

<pre>
GET: /getData?for=myapp&amp;uid=1234&amp;from=google
</pre>

    <p>The data is returned in a format "myapp" understands. The search / retrievial only works when the user authorizes such access when she logs into Google Health in the setup process.</p>

    
    <p><strong>Try it now!</strong></p>

    <p><strong>Step 1: <a href="/demo/add.jsp">Send us the username to connect</a>.</strong> You app needs to first send us an unique user id of the user, and the EHR / PHR system s/he wants to connect to. The user id only needs to be unqiue for your app (you can just give us the username). Each of your user can be connected to multiple outside EHR / PHR systems, although Google Health is only one supported in this demo.</p>

    <p><strong>Step 2: User authorizes access.</strong> At the end of Step #1, we gave you a dynamic URL for your user to log into the 3rd party system (Google Health in this case). Please present that web page to the user and ask him/her to login.</p>

    <p><strong>Step 3: <a href="/demo/send.jsp">Send a test message</a>.</strong> Once the user is successfully connected, you can send a test message on behalf of the user and get propogate to the user's connected Google Health account.</p>

    <p>Connected users:
    <c:forEach items="${requestScope.users}" var="user">
        ${user}, 
    </c:forEach>
    </p>

</div>
</center></body>
</html>
